package com.huyanqi.entity;

import java.util.Calendar;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.huyanqi.core.BaseDomainObject;
import com.huyanqi.core.util.JaxbCalendarSerializer;

@Entity
@Table(name = "u_sign")
@XmlAccessorType(XmlAccessType.FIELD)
public class Sign extends BaseDomainObject {
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Id
	@Column(name="si_id",nullable=false)
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long siId;

	public void setSiId(Long siId) {
		this.siId = siId;
	}
	public Long getSiId() {
		return siId;
	}

	@Column(name="si_user")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long siUser;

	public void setSiUser(Long siUser) {
		this.siUser = siUser;
	}
	public Long getSiUser() {
		return siUser;
	}

	@Column(name="si_shop")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long siShop;

	public void setSiShop(Long siShop) {
		this.siShop = siShop;
	}
	public Long getSiShop() {
		return siShop;
	}

	@Column(name="si_time")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	@XmlJavaTypeAdapter(JaxbCalendarSerializer.class)
	@Temporal(TemporalType.TIMESTAMP)	
	private Calendar siTime;

	public void setSiTime(Calendar siTime) {
		this.siTime = siTime;
	}
	public Calendar getSiTime() {
		return siTime;
	}

	@Column(name="si_weather")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Integer siWeather;

	public void setSiWeather(Integer siWeather) {
		this.siWeather = siWeather;
	}
	public Integer getSiWeather() {
		return siWeather;
	}

	@Column(name="si_mood")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Integer siMood;

	public void setSiMood(Integer siMood) {
		this.siMood = siMood;
	}
	public Integer getSiMood() {
		return siMood;
	}
	
	@Transient
	private String uHead;
	
	public String getuHead() {
		return uHead;
	}
	public void setuHead(String uHead) {
		this.uHead = uHead;
	}
	public Sign() {}
	public Sign(Long siId, Long siUser, Long siShop, Calendar siTime,Integer siWeather, Integer siMood, String uHead) {
		super();
		this.siId = siId;
		this.siUser = siUser;
		this.siShop = siShop;
		this.siTime = siTime;
		this.siWeather = siWeather;
		this.siMood = siMood;
		this.uHead = uHead;
	}

	
}